﻿

CREATE FUNCTION [dbo].[Car_Years] 
()RETURNS TABLE
AS
RETURN

SELECT YEAR(DATEADD(yy,1,Now)) Year FROM v_Now
UNION
SELECT YEAR(DATEADD(yy,0,Now)) Year FROM v_Now
UNION
SELECT YEAR(DATEADD(yy,-1,Now)) Year FROM v_Now
UNION
SELECT YEAR(DATEADD(yy,-2,Now)) Year FROM v_Now
UNION
SELECT YEAR(DATEADD(yy,-3,Now)) Year FROM v_Now
UNION
SELECT YEAR(DATEADD(yy,-4,Now)) Year FROM v_Now
UNION
SELECT YEAR(DATEADD(yy,-5,Now)) Year FROM v_Now
UNION
SELECT YEAR(DATEADD(yy,-6,Now)) Year FROM v_Now
UNION
SELECT YEAR(DATEADD(yy,-7,Now)) Year FROM v_Now
UNION
SELECT YEAR(DATEADD(yy,-8,Now)) Year FROM v_Now
UNION
SELECT YEAR(DATEADD(yy,-9,Now)) Year FROM v_Now
UNION
SELECT YEAR(DATEADD(yy,-10,Now)) Year FROM v_Now
UNION
SELECT YEAR(DATEADD(yy,-11,Now)) Year FROM v_Now
UNION
SELECT YEAR(DATEADD(yy,-12,Now)) Year FROM v_Now
UNION
SELECT YEAR(DATEADD(yy,-13,Now)) Year FROM v_Now
UNION
SELECT YEAR(DATEADD(yy,-14,Now)) Year FROM v_Now
UNION
SELECT YEAR(DATEADD(yy,-15,Now)) Year FROM v_Now
UNION
SELECT YEAR(DATEADD(yy,-16,Now)) Year FROM v_Now
UNION
SELECT YEAR(DATEADD(yy,-17,Now)) Year FROM v_Now
--dbo.Split(',2006,2005,2004,2003,2002,2001,2000,1999,1998,1997,1996',',')


